Skip to content

feat(notifications): delete flows (PR 3/7)#514

Merged
sarthak688 merged 1 commit into
mainfrom
feat/notifications-delete
Jul 2, 2026
Merged

feat(notifications): delete flows (PR 3/7)#514
sarthak688 merged 1 commit into
mainfrom
feat/notifications-delete

Conversation

@sarthak688

@sarthak688 sarthak688 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

PR 3/7 in the Notification SDK stack. Rebased onto main (foundation #512 and mark-read #513 are now merged).

Adds the two delete methods. Both POST to the same DeleteBulk OData action endpoint; deleteAll uses the server-side deleteAll flag.

Methods Added

Layer Method Signature
Service notifications.deleteByIds() deleteByIds(tenantId: string, notificationIds: string[]): Promise<NotificationDeleteResponse>
Service notifications.deleteAll() deleteAll(tenantId: string): Promise<NotificationDeleteAllResponse>

Both methods are tagged @internal (consistent with the rest of the notification service), so no docs/oauth-scopes.md entry is added.

Endpoint Called

Method HTTP Endpoint
deleteByIds() / deleteAll() POST notificationservice_/notificationserviceapi/odata/v1/NotificationEntry/UiPath.NotificationService.Api.DeleteBulk

Implementation Notes

  • Tenant forwarding: every method takes the acting tenant GUID as its first argument; the SDK forwards it to the notification API via the X-UIPATH-Internal-TenantId header on each call.
  • API spec misspelling preserved: the server expects the request body key as notifcationIds (sic), not notificationIds. The SDK preserves the typo to match the live API; the SDK's public surface uses the correct spelling.
  • deleteByIds rejects empty arrays at the server with HTTP 400 — documented in JSDoc; the SDK doesn't add a client-side guard to avoid drift if the server relaxes that constraint.
  • deleteAll sends { notifcationIds: [], deleteAll: true } — the server deletes everything for the acting user regardless.

Example Usage

import { Notifications } from '@uipath/uipath-typescript/notifications';

const notifications = new Notifications(sdk);
const tenantId = '<tenant-guid>';

await notifications.deleteByIds(tenantId, ['<notificationId-1>', '<notificationId-2>']);
await notifications.deleteAll(tenantId);

API Response vs SDK Response

Method SDK Response
deleteByIds { success: true, data: { notificationIds } }
deleteAll { success: true, data: { all: true } }

Verification

Check Status
npm run typecheck ✅ clean
npm run lint ✅ 0 warnings, 0 errors
npm run test:unit ✅ 16 tests in notification suite

No integration tests for the delete methods — they destructively mutate the inbox with no SDK-level undo and would be hostile to repeat-run CI. Covered by unit tests for SDK shape and by manual smoke tests for live behaviour.

Files

Area Files
Endpoint constants src/utils/constants/endpoints/notification.ts (DELETE_BULK)
Models src/models/notification/notifications.types.ts (response types), src/models/notification/notifications.models.ts (ServiceModel methods)
Service src/services/notification/notifications.ts
Unit tests tests/unit/services/notification/notifications.test.ts (+4 tests)
Integration tests tests/integration/shared/notification/notifications.integration.test.ts (note added explaining why no tests)

PR Stack

# Branch Status
1 feat/notifications-sdk #512 (merged)
2 feat/notifications-mark-read #513 (merged)
3 feat/notifications-delete (this PR)
4 feat/subscriptions-sdk upcoming
5 feat/subscriptions-topic-updates upcoming
6 feat/subscriptions-publisher-updates upcoming
7 feat/subscriptions-mode-reset upcoming

🤖 Generated with Claude Code

@claude

claude Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

Comment thread tests/unit/services/notification/notifications.test.ts
@sarthak688
sarthak688 force-pushed the feat/notifications-mark-read branch 5 times, most recently from aaaef48 to 5bdbf0a Compare July 1, 2026 13:32
Comment thread tests/unit/services/notification/notifications.test.ts Outdated
@sarthak688
sarthak688 force-pushed the feat/notifications-mark-read branch 3 times, most recently from 95b10b2 to a0128d8 Compare July 2, 2026 05:05
Base automatically changed from feat/notifications-mark-read to main July 2, 2026 05:22
@sarthak688
sarthak688 requested a review from a team July 2, 2026 05:22
@sarthak688
sarthak688 force-pushed the feat/notifications-delete branch from a489927 to fe38d8a Compare July 2, 2026 07:55
@claude

claude Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

Comment thread src/models/notification/notifications.models.ts Outdated
@sarthak688
sarthak688 requested a review from Sarath1018 July 2, 2026 08:47
…nal]

Adds the two delete methods on top of the notifications foundation and
mark-read flows already on main. Both POST to the NotificationEntry.DeleteBulk
OData action; deleteAll uses the server-side deleteAll flag.

Both methods are tagged @internal (consistent with the rest of the
notification service) so no oauth-scopes entry is added.

Tests: 4 unit tests (deleteByIds + deleteAll, success + error).
No integration tests — these destructively mutate the inbox with no
SDK-level undo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sarthak688
sarthak688 force-pushed the feat/notifications-delete branch from fe38d8a to 28f2e06 Compare July 2, 2026 12:22
@claude

claude Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

✅ No issues found. Checked for bugs and CLAUDE.md compliance.

@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

@sarthak688
sarthak688 merged commit deaf5c6 into main Jul 2, 2026
18 checks passed
@sarthak688
sarthak688 deleted the feat/notifications-delete branch July 2, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants